<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>SQL安装引导</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
    <link href="../static/admin/bootstrap-3.3.0-dist/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="../static/admin/css/site.css" rel="stylesheet">
    <link href="../static/admin/font-awesome-4.7.0/css/font-awesome.min.css" rel="stylesheet">

    <script src="../static/admin/js/jquery-1.12.4.js"></script>
    <script src="../static/admin/bootstrap-3.3.0-dist/dist/js/bootstrap.min.js"></script>
    <!--CSS-->
    <link rel="stylesheet" href="css/sqlInstall.css">
</head>
<body>
<script src="../static//admin/canvas.js"></script>
<div class="container-fluid admin-top">
    <!--导航-->
    <nav class="navbar navbar-inverse">
        <div class="container-fluid">
            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                <h4 style="display: inline;line-height: 50px;float: left;margin: 0px">
                    <a style="color: white;margin-left: -14px">SQL安装引导</a>
                </h4>
            </div>
        </div>
    </nav>
    <!--导航end-->
</div>
<div class="container">
    <ul class="nav nav-pills nav-justified">
        <li><a href="##">使用协议</a></li>
        <li><a href="##" class="active">环境检测</a></li>
        <li><a href="##">创建数据</a></li>
        <li><a href="##">安装完成</a></li>
    </ul>
    <div class="content">

        <h2>环境监测</h2>
        <table class="table table-border">
            <tr>
                <th width="25%">坏境</th>
                <th width="25%">最低配置</th>
                <th width="25%">当前配置</th>
                <th width="25%">是否符合</th>
            </tr>
            <tr>
                <td>操作系统</td>
                <td>不限</td>
                <td><?php echo php_uname('s'); ?></td>
                <td class="yes">√</td>
            </tr>
            <tr>
                <td>php版本</td>
                <td>&gt;5.3</td>
                <td><?php echo PHP_VERSION ?></td>
                <?php $php_version=explode('.', PHP_VERSION); ?>
                <td class="<?php if(($php_version['0']>=7) || ($php_version['0']>=5 && $php_version['1']>=3)){echo 'yes';} ?>">
                    <?php if (($php_version['0']>=7) || ($php_version['0']>=5 && $php_version['1']>=3)): ?>
                    √
                    <?php else: ?>
                    ×
                    <?php endif ?>
                </td>
            </tr>
        </table>
        <h2>目录权限</h2>
        <table class="table table-border">
            <tr>
                <th width="25%">坏境</th>
                <th width="25%">最低配置</th>
                <th width="25%">当前配置</th>
                <th width="25%">是否符合</th>
            </tr>
            <tr>
                <td>./</td>
                <td>可写</td>
                <td>
                    <?php if (is_writable('../../')): ?>
                    可写
                    <?php else: ?>
                    不可写
                    <?php endif ?>
                </td>
                <td class="<?php if(is_writable('../../'))echo 'yes'; ?>">
                    <?php if (is_writable('../../')): ?>
                    √
                    <?php else: ?>
                    ×
                    <?php endif ?>
                </td>
            </tr>
            <tr>
                <td>./runtime</td>
                <td>可写</td>
                <td>
                    <?php if (is_writable('../../runtime')): ?>
                    可写
                    <?php else: ?>
                    不可写
                    <?php endif ?>
                </td>
                <td class="<?php if(is_writable('../../runtime'))echo 'yes'; ?>">
                    <?php if (is_writable('../../runtime')): ?>
                    √
                    <?php else: ?>
                    ×
                    <?php endif ?>
                </td>
            </tr>
            <tr>
                <td>./public</td>
                <td>可写</td>
                <td>
                    <?php if (is_writable('../../public')): ?>
                    可写
                    <?php else: ?>
                    不可写
                    <?php endif ?>
                </td>
                <td class="<?php if(is_writable('../../public'))echo 'yes'; ?>">
                    <?php if (is_writable('../../public')): ?>
                    √
                    <?php else: ?>
                    ×
                    <?php endif ?>
                </td>
            </tr>
        </table>
        <div class="agree">
            <a class="btn btn-primary" href="./index.php?i=agreement">上一步</a>
            <a class="btn btn-success" href="javascript:;" onclick="testClick()">下一步</a>
        </div>
    </div>
</div>
<script>
    function testClick(){
        if($('.yes').length!=5){
            alert('您的配置或权限不符合要求');
        }else{
            location.href='./index.php?i=create';
        }
    }
</script>
</body>
</html>
